define([
  './defaultValue-81eec7ed',
  './Transforms-08771371',
  './Matrix2-47e98d76',
  './RuntimeError-8952249c',
  './ComponentDatatype-a15c9a19',
  './GeometryAttribute-64b853f6',
  './GeometryAttributes-32b29525',
  './VertexFormat-a0b706b0',
  './commonjsHelpers',
  './combine-3c023bda',
  './WebGLConstants-508b9636',
], function (e, t, n, r, a, o, i, m, u, c, p) {
  'use strict'
  function s(t) {
    t = e.defaultValue(t, e.defaultValue.EMPTY_OBJECT)
    const n = e.defaultValue(t.vertexFormat, m.VertexFormat.DEFAULT)
    ;(this._vertexFormat = n), (this._workerName = 'createPlaneGeometry')
  }
  ;(s.packedLength = m.VertexFormat.packedLength),
    (s.pack = function (t, n, r) {
      return (r = e.defaultValue(r, 0)), m.VertexFormat.pack(t._vertexFormat, n, r), n
    })
  const y = new m.VertexFormat(),
    l = { vertexFormat: y }
  s.unpack = function (t, n, r) {
    n = e.defaultValue(n, 0)
    const a = m.VertexFormat.unpack(t, n, y)
    return e.defined(r)
      ? ((r._vertexFormat = m.VertexFormat.clone(a, r._vertexFormat)), r)
      : new s(l)
  }
  const b = new n.Cartesian3(-0.5, -0.5, 0),
    A = new n.Cartesian3(0.5, 0.5, 0)
  return (
    (s.createGeometry = function (e) {
      const r = e._vertexFormat,
        m = new i.GeometryAttributes()
      let u, c
      if (r.position) {
        if (
          ((c = new Float64Array(12)),
          (c[0] = b.x),
          (c[1] = b.y),
          (c[2] = 0),
          (c[3] = A.x),
          (c[4] = b.y),
          (c[5] = 0),
          (c[6] = A.x),
          (c[7] = A.y),
          (c[8] = 0),
          (c[9] = b.x),
          (c[10] = A.y),
          (c[11] = 0),
          (m.position = new o.GeometryAttribute({
            componentDatatype: a.ComponentDatatype.DOUBLE,
            componentsPerAttribute: 3,
            values: c,
          })),
          r.normal)
        ) {
          const e = new Float32Array(12)
          ;(e[0] = 0),
            (e[1] = 0),
            (e[2] = 1),
            (e[3] = 0),
            (e[4] = 0),
            (e[5] = 1),
            (e[6] = 0),
            (e[7] = 0),
            (e[8] = 1),
            (e[9] = 0),
            (e[10] = 0),
            (e[11] = 1),
            (m.normal = new o.GeometryAttribute({
              componentDatatype: a.ComponentDatatype.FLOAT,
              componentsPerAttribute: 3,
              values: e,
            }))
        }
        if (r.st) {
          const e = new Float32Array(8)
          ;(e[0] = 0),
            (e[1] = 0),
            (e[2] = 1),
            (e[3] = 0),
            (e[4] = 1),
            (e[5] = 1),
            (e[6] = 0),
            (e[7] = 1),
            (m.st = new o.GeometryAttribute({
              componentDatatype: a.ComponentDatatype.FLOAT,
              componentsPerAttribute: 2,
              values: e,
            }))
        }
        if (r.tangent) {
          const e = new Float32Array(12)
          ;(e[0] = 1),
            (e[1] = 0),
            (e[2] = 0),
            (e[3] = 1),
            (e[4] = 0),
            (e[5] = 0),
            (e[6] = 1),
            (e[7] = 0),
            (e[8] = 0),
            (e[9] = 1),
            (e[10] = 0),
            (e[11] = 0),
            (m.tangent = new o.GeometryAttribute({
              componentDatatype: a.ComponentDatatype.FLOAT,
              componentsPerAttribute: 3,
              values: e,
            }))
        }
        if (r.bitangent) {
          const e = new Float32Array(12)
          ;(e[0] = 0),
            (e[1] = 1),
            (e[2] = 0),
            (e[3] = 0),
            (e[4] = 1),
            (e[5] = 0),
            (e[6] = 0),
            (e[7] = 1),
            (e[8] = 0),
            (e[9] = 0),
            (e[10] = 1),
            (e[11] = 0),
            (m.bitangent = new o.GeometryAttribute({
              componentDatatype: a.ComponentDatatype.FLOAT,
              componentsPerAttribute: 3,
              values: e,
            }))
        }
        ;(u = new Uint16Array(6)),
          (u[0] = 0),
          (u[1] = 1),
          (u[2] = 2),
          (u[3] = 0),
          (u[4] = 2),
          (u[5] = 3)
      }
      return new o.Geometry({
        attributes: m,
        indices: u,
        primitiveType: o.PrimitiveType.TRIANGLES,
        boundingSphere: new t.BoundingSphere(n.Cartesian3.ZERO, Math.sqrt(2)),
      })
    }),
    function (t, n) {
      return e.defined(n) && (t = s.unpack(t, n)), s.createGeometry(t)
    }
  )
})
